Add eachtile for stepped tile windows#281
Merged
Merged
Conversation
Collaborator
|
|
The load/store emit code for partition and strided views was near-identical: both lower to the same load_view_tko/store_view_tko ops. Factor it into shared emit_view_load!/emit_view_store! helpers (and a shared tfunc helper), keeping the four distinct intrinsic identities that token_order_pass! relies on to treat overlapping strided windows conservatively. Also let get_index_space_shape accept a StridedView operand — the Tile IR op takes any tile view since v13.1 — and drop the make_strided_view version check that merely duplicated the bytecode-layer v13.3 gates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Drop underscore prefixes from the eachtile helpers and collapse the duplicated step accessor; the type-parameter accessors now live on the type with instance forwarders. - Define Base.eltype on TiledView: the element is a whole tile of the user-requested shape. - Require `step` to match `tile_shape` in length instead of padding short steps with 1s, which silently meant "overlap with step 1" on padded dimensions; a short shape/step pair now pads the trailing dimensions together. - Overlay Base.size on TiledView in kernels to defer the tile count to the backend via get_index_space_shape (matching cuTile Python's num_tiles lowering) instead of baking in the host cld formula; the host method keeps cld for launch-grid sizing. - Return the collection from setindex!, per convention. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Expose the view dim_map through the same 1-indexed `order` kwarg that ct.load/ct.store already provide: tile_shape[i], step[i], and tile index i describe tile dimension i, which maps to array dimension order[i]. The permutation is carried as a sixth TiledView type parameter and threaded into both the partition and strided view constructors, making the previously unreachable make_strided_view dim_map arm exercisable from the public API. The host-side size(tiles) pairs step[i] with array dim order[i]; the device-side overlay needs no change since get_index_space_shape respects the view's dim_map in the backend. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
eachtile, a Julia-facing array-of-tiles view:stepcontrols the distance between tile origins:tile_shape: adjacent partitions;This mirrors cuTile Python’s
Array.tiled_view(..., traversal_steps=...), with Julia-native API choices:stepinstead oftraversal_steps;size(tiles)instead ofnum_tiles;ct.load/ct.storeinstead of.load/.store.Equal/default steps preserve the existing
PartitionViewlowering and work on older bytecode versions. Unequal steps lower through Tile IR v13.3StridedView.It's a bit of a pun on
eachslice, but still reads significantly nicer than Python'straversal_steps, I think. @AntonOresten, any thoughts?